import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/public/public_alert.dart';
import 'package:honeypotflutter/public/public_storage.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_button.dart';

class CabinetFormDeliverLogic extends GetxController {
  bool isShow = false;
  String _key = "cabinet_first_show";
  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    isShow = HLStorage.getStorage<bool>(_key) ?? false;
  }

  /*
  * 时间弹框
  * */
  firstShowGuidWidget() async {
    if (isShow) {
      return;
    }
    Future.delayed(Duration(seconds: 2), () {
      HLAlert.showSureCancelAlert(builder: (
        BuildContext context,
        Widget child,
      ) {
        return Container(
          padding: EdgeInsets.only(top: 300),
          child: Column(
            children: [
              Image.asset(MGImage.image("cabinet_guide", type: ImagePathType.cabinet)),
              MGButton(
                title: "我知道了",
                backColor: Colors.transparent,
                margin: EdgeInsets.only(left: 50, right: 50, top: 40),
                buttonAction: () {
                  HLStorage.setStorage(_key, true);
                  Get.back();
                },
              ),
            ],
          ),
        );
      });
    });
  }
}
